home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / emacssrc.zip / EMACSSRC.TAR / emacs-19.17 / configure < prev    next >
Text File  |  1993-07-18  |  62KB  |  2,336 lines

  1. #!/bin/sh
  2. #### Configuration script for GNU Emacs
  3. #### Copyright (C) 1992 Free Software Foundation, Inc.
  4.  
  5. ### Don't edit this script!
  6. ### This script was automatically generated by the `autoconf' program
  7. ### from the file `./configure.in'.
  8. ### To rebuild it, execute the command
  9. ###    autoconf
  10. ### in the this directory.  You must have autoconf version 1.4 or later.
  11.  
  12. ### This file is part of GNU Emacs.
  13.  
  14. ### GNU Emacs is free software; you can redistribute it and/or modify
  15. ### it under the terms of the GNU General Public License as published by
  16. ### the Free Software Foundation; either version 1, or (at your option)
  17. ### any later version.
  18.  
  19. ### GNU Emacs is distributed in the hope that it will be useful,
  20. ### but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. ### GNU General Public License for more details.
  23.  
  24. ### You should have received a copy of the GNU General Public License
  25. ### along with GNU Emacs; see the file COPYING.  If not, write to
  26. ### the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  27.  
  28.  
  29. ### Since Emacs has configuration requirements that autoconf can't
  30. ### meet, this file is an unholy marriage of custom-baked
  31. ### configuration code and autoconf macros.
  32. ###
  33. ### We use the m4 quoting characters [ ] (as established by the
  34. ### autoconf system) to include large sections of raw sewage - Oops, I
  35. ### mean, shell code - in the final configuration script.
  36. ###
  37. ### Usage: configure config_name
  38. ###
  39. ### If configure succeeds, it leaves its status in config.status.
  40. ### If configure fails after disturbing the status quo,
  41. ###     config.status is removed.
  42.  
  43.  
  44. ### Remove any more than one leading "." element from the path name.
  45. ### If we don't remove them, then another "./" will be prepended to
  46. ### the file name each time we use config.status, and the program name
  47. ### will get larger and larger.  This wouldn't be a problem, except
  48. ### that since progname gets recorded in all the Makefiles this script
  49. ### produces, move-if-change thinks they're different when they're
  50. ### not.
  51. ###
  52. ### It would be nice if we could put the ./ in a \( \) group and then
  53. ### apply the * operator to that, so we remove as many leading ./././'s
  54. ### as are present, but some seds (like Ultrix's sed) don't allow you to
  55. ### apply * to a \( \) group.  Bleah.
  56. progname="`echo $0 | sed 's:^\./\./:\./:'`"
  57.  
  58.  
  59. #### Usage messages.
  60.  
  61. short_usage="Usage: ${progname} CONFIGURATION [-OPTION[=VALUE] ...]
  62.  
  63. Set compilation and installation parameters for GNU Emacs, and report.
  64. CONFIGURATION specifies the machine and operating system to build for.
  65. --with-x        Support the X Window System.
  66. --with-x=no        Don't support X.
  67. --x-includes=DIR     Search for X header files in DIR.
  68. --x-libraries=DIR    Search for X libraries in DIR.
  69. --with-gcc        Use GCC to compile Emacs.
  70. --with-gcc=no        Don't use GCC to compile Emacs.
  71. --run-in-place        Use libraries and data files directly out of the 
  72.             source tree.
  73. --srcdir=DIR        Look for source in DIR.
  74. --prefix=DIR        Install files below dir.
  75.  
  76. If successful, ${progname} leaves its status in config.status.  If
  77. unsuccessful after disturbing the status quo, it removes config.status."
  78.  
  79.  
  80. #### Option processing.
  81.  
  82. ### Record all the arguments, so we can save them in config.status.
  83. arguments="$@"
  84.  
  85. ### These values are used to comment and uncomment different values
  86. ### for the path variables in the Makefile, to choose the installed
  87. ### configuration or the run-in-place configuration.
  88. rip_paths='#disabled# '
  89. inst_paths=''
  90.  
  91. ### Establish some default values.
  92. prefix='/usr/local'
  93. exec_prefix='${prefix}'
  94.  
  95. ### Don't use shift -- that destroys the argument list, which autoconf needs
  96. ### to produce config.status.  It turns out that "set - ${arguments}" doesn't
  97. ### work portably.
  98. index=0
  99. while [ $index -lt $# ]; do
  100.   index=`expr $index + 1`
  101.   arg=`eval echo '$'$index`
  102.   case "${arg}" in
  103.  
  104.     ## Anything starting with a hyphen we assume is an option.
  105.     -* )
  106.  
  107.       ## Separate the switch name from the value it's being given.
  108.       case "${arg}" in
  109.         -*=*)
  110.       opt=`echo ${arg} | sed 's:^-*\([^=]*\)=.*$:\1:'`
  111.       val=`echo ${arg} | sed 's:^-*[^=]*=\(.*\)$:\1:'`
  112.       valomitted=no
  113.     ;;
  114.         -*)
  115.           ## If FOO is a boolean argument, --FOO is equivalent to
  116.           ## --FOO=yes.  Otherwise, the value comes from the next
  117.           ## argument - see below.
  118.       opt=`echo ${arg} | sed 's:^-*\(.*\)$:\1:'`
  119.           val="yes"
  120.           valomitted=yes
  121.         ;;
  122.       esac
  123.  
  124.       ## Change `-' in the option name to `_'.
  125.       optname="${opt}"
  126.       opt="`echo ${opt} | tr - _`"
  127.  
  128.       ## Process the option.
  129.       case "${opt}" in
  130.  
  131.         ## Has the user specified which window systems they want to support?
  132.         "with_x" | "with_x11" | "with_x10" )
  133.       ## Make sure the value given was either "yes" or "no".
  134.       case "${val}" in
  135.         y | ye | yes )    val=yes ;;
  136.         n | no )        val=no  ;;
  137.         * )
  138.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  139. Set it to either \`yes' or \`no'."
  140.            echo "${short_usage}") >&2
  141.           exit 1
  142.         ;;
  143.       esac
  144.           eval "${opt}=\"${val}\""
  145.         ;;
  146.  
  147.     ## Has the user specified whether or not they want GCC?
  148.     "with_gcc" | "with_gnu_cc" )
  149.       ## Make sure the value given was either "yes" or "no".
  150.       case "${val}" in
  151.         y | ye | yes )    val=yes ;;
  152.         n | no )        val=no  ;;
  153.         * )
  154.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  155. Set it to either \`yes' or \`no'."
  156.            echo "${short_usage}") >&2
  157.           exit 1
  158.         ;;
  159.       esac
  160.           eval "${opt}=\"${val}\""
  161.         ;;
  162.  
  163.         ## Has the user specified a source directory?
  164.     "srcdir" )
  165.       ## If the value was omitted, get it from the next argument.
  166.       if [ "${valomitted}" = "yes" ]; then
  167.         ## Get the next argument from the argument list, if there is one.
  168.             if [ $index = $# ]; then
  169.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  170.     \`--${optname}=FOO'."
  171.            echo "${short_usage}") >&2
  172.           exit 1
  173.         fi
  174.             index=`expr $index + 1`
  175.             val=`eval echo '$'$index`
  176.       fi
  177.           srcdir="${val}"
  178.     ;;
  179.  
  180.     ## Has the user tried to tell us where the X files are?
  181.     ## I think these are dopey, but no less than three alpha
  182.     ## testers, at large sites, have said they have their X files
  183.     ## installed in odd places.
  184.     "x_includes" )
  185.       ## If the value was omitted, get it from the next argument.
  186.       if [ "${valomitted}" = "yes" ]; then
  187.         ## Get the next argument from the argument list, if there is one.
  188.             if [ $index = $# ]; then
  189.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  190.     \`--${optname}=FOO'."
  191.            echo "${short_usage}") >&2
  192.           exit 1
  193.         fi
  194.             index=`expr $index + 1`
  195.             val=`eval echo '$'$index`
  196.       fi
  197.       x_includes="${val}"
  198.       C_SWITCH_X_SITE="-I\"${x_includes}\""
  199.         ;;
  200.     "x_libraries" )
  201.       ## If the value was omitted, get it from the next argument.
  202.       if [ "${valomitted}" = "yes" ]; then
  203.         ## Get the next argument from the argument list, if there is one.
  204.             if [ $index = $# ]; then
  205.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  206.     \`--${optname}=FOO'."
  207.            echo "${short_usage}") >&2
  208.           exit 1
  209.         fi
  210.             index=`expr $index + 1`
  211.             val=`eval echo '$'$index`
  212.       fi
  213.       x_libraries="${val}"
  214.       LD_SWITCH_X_SITE="-L\"${x_libraries}\""
  215.         ;;
  216.  
  217.     ## Should this use the "development configuration"?
  218.     "run_in_place" )
  219.       rip_paths=''
  220.       inst_paths='#disabled# '
  221.     ;;
  222.  
  223.     ## Has the user specified an installation prefix?
  224.     "prefix" )
  225.       ## If the value was omitted, get it from the next argument.
  226.       if [ "${valomitted}" = "yes" ]; then
  227.         ## Get the next argument from the argument list, if there is one.
  228.             if [ $index = $# ]; then
  229.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  230.     \`--${optname}=FOO'."
  231.            echo "${short_usage}") >&2
  232.           exit 1
  233.         fi
  234.             index=`expr $index + 1`
  235.             val=`eval echo '$'$index`
  236.       fi
  237.       prefix="${val}"
  238.         ;;
  239.  
  240.     ## Has the user specified an installation prefix?
  241.     "exec_prefix" )
  242.       ## If the value was omitted, get it from the next argument.
  243.       if [ "${valomitted}" = "yes" ]; then
  244.         ## Get the next argument from the argument list, if there is one.
  245.             if [ $index = $# ]; then
  246.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  247.     \`--${optname}=FOO'."
  248.            echo "${short_usage}") >&2
  249.           exit 1
  250.         fi
  251.             index=`expr $index + 1`
  252.             val=`eval echo '$'$index`
  253.       fi
  254.       exec_prefix="${val}"
  255.         ;;
  256.  
  257.     ## Verbose flag, tested by autoconf macros.
  258.     "verbose" )
  259.       verbose=yes
  260.     ;;
  261.  
  262.     ## Has the user asked for some help?
  263.     "usage" | "help" )
  264.       echo "${short_usage}" | more
  265.       exit
  266.     ;;
  267.  
  268.         ## We ignore all other options silently.
  269.       esac
  270.     ;;
  271.  
  272.     ## Anything not starting with a hyphen we assume is a
  273.     ## configuration name.
  274.     *)
  275.       configuration=${arg}
  276.     ;;
  277.  
  278.   esac
  279. done
  280.  
  281. if [ "${configuration}" = "" ]; then
  282.   echo '- You did not tell me what kind of host system you want to configure.
  283. - I will attempt to guess the kind of system this is.' 1>&2
  284.   guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
  285.   if configuration=`${guesssys}` ; then
  286.     echo "- Looks like this is a ${configuration}" 1>&2
  287.   else
  288.     echo '- Failed to guess the system type.  You need to tell me.' 1>&2
  289.     echo "${short_usage}" >&2
  290.     exit 1
  291.   fi
  292. fi
  293.  
  294. #### Decide where the source is.
  295. case "${srcdir}" in
  296.  
  297.   ## If it's not specified, see if  `.' or `..' might work.
  298.   "" )
  299.     confdir=`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`
  300.     if [ -f $confdir/src/lisp.h -a -f $confdir/lisp/version.el ]; then
  301.       srcdir="${confdir}"
  302.     else
  303.       if [ -f "./src/lisp.h" -a -f "./lisp/version.el" ]; then
  304.         srcdir='.'
  305.       else
  306.         if [ -f "../src/lisp.h" -a -f "../lisp/version.el" ]; then
  307.       srcdir='..'
  308.         else
  309.       (echo "\
  310. ${progname}: Neither the current directory nor its parent seem to
  311. contain the Emacs sources.  If you do not want to build Emacs in its
  312. source tree, you should run \`${progname}' in the directory in which
  313. you wish to build Emacs, using its \`--srcdir' option to say where the
  314. sources may be found."
  315.         echo "${short_usage}") >&2
  316.       exit 1
  317.         fi
  318.       fi
  319.     fi
  320.   ;;
  321.  
  322.   ## Otherwise, check if the directory they specified is okay.
  323.   * )
  324.     if [ ! -d "${srcdir}" -o ! -f "${srcdir}/src/lisp.h" -o ! -f "${srcdir}/lisp/version.el" ]; then
  325.       (echo "\
  326. ${progname}: The directory specified with the \`--srcdir' option,
  327. \`${srcdir}', doesn't seem to contain the Emacs sources.  You should
  328. either run the \`${progname}' script at the top of the Emacs source
  329. tree, or use the \`--srcdir' option to specify where the Emacs sources
  330. are."
  331.        echo "${short_usage}") >&2
  332.       exit 1
  333.     fi
  334.   ;;
  335. esac
  336.  
  337. #### Make srcdir absolute, if it isn't already.  It's important to
  338. #### avoid running the path through pwd unnecessary, since pwd can
  339. #### give you automounter prefixes, which can go away.
  340. case "${srcdir}" in
  341.   /* ) ;;
  342.   . )
  343.     ## We may be able to use the $PWD environment variable to make this
  344.     ## absolute.  But sometimes PWD is inaccurate.
  345.     if [ "${PWD}" != "" ] && [ "`(cd ${PWD} ; pwd)`" = "`pwd`" ] ; then
  346.       srcdir="$PWD"
  347.     else
  348.       srcdir="`(cd ${srcdir}; pwd)`"
  349.     fi
  350.   ;;
  351.   *  ) srcdir="`(cd ${srcdir}; pwd)`" ;;
  352. esac
  353.  
  354. #### Make sure that the source directory doesn't already have a
  355. #### configured system in it.
  356. if [ `pwd` != `(cd ${srcdir} && pwd)` ] \
  357.    && [ -f "${srcdir}/src/config.h" ] ; then
  358.   (echo "${progname}: the directory tree \`${srcdir}' is being used"
  359.    echo "   as a build directory right now; it has been configured in its own"
  360.    echo "   right.  You can't use srcdir in this situation.") >&2
  361.   exit 1
  362. fi
  363.  
  364. ### Make the necessary directories, if they don't exist.
  365. for dir in ./src ./lib-src ./cpp ./oldXMenu ./etc ; do
  366.   if [ ! -d ${dir} ]; then
  367.     mkdir ${dir}
  368.   fi
  369. done
  370.  
  371. #### Given the configuration name, set machfile and opsysfile to the
  372. #### names of the m/*.h and s/*.h files we should use.
  373.  
  374. ### Canonicalize the configuration name.
  375. echo "Checking the configuration name."
  376. if configuration=`${srcdir}/config.sub "${configuration}"` ; then : ; else
  377.   exit $?
  378. fi
  379.  
  380. ### If you add support for a new configuration, add code to this
  381. ### switch statement to recognize your configuration name and select
  382. ### the appropriate operating system and machine description files.
  383.  
  384. ### You would hope that you could choose an m/*.h file pretty much
  385. ### based on the machine portion of the configuration name, and an s-
  386. ### file based on the operating system portion.  However, it turns out
  387. ### that each m/*.h file is pretty manufacturer-specific - for
  388. ### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are
  389. ### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS
  390. ### machines.  So we basically have to have a special case for each
  391. ### configuration name.
  392. ###
  393. ### As far as handling version numbers on operating systems is
  394. ### concerned, make sure things will fail in a fixable way.  If
  395. ### /etc/MACHINES doesn't say anything about version numbers, be
  396. ### prepared to handle anything reasonably.  If version numbers
  397. ### matter, be sure /etc/MACHINES says something about it.
  398. ###
  399. ### Eric Raymond says we should accept strings like "sysvr4" to mean
  400. ### "System V Release 4"; he writes, "The old convention encouraged
  401. ### confusion between `system' and `release' levels'."
  402.  
  403. machine='' opsys='' unported='false'
  404. case "${configuration}" in
  405.  
  406.   ## Alliant machines
  407.   ## Strictly speaking, we need the version of the alliant operating
  408.   ## system to choose the right machine file, but currently the
  409.   ## configuration name doesn't tell us enough to choose the right
  410.   ## one; we need to give alliants their own operating system name to
  411.   ## do this right.  When someone cares, they can help us.
  412.   fx80-alliant-* )
  413.     machine=alliant4 opsys=bsd4-2
  414.   ;;
  415.   i860-alliant-* )
  416.     machine=alliant-2800 opsys=bsd4-3
  417.   ;;
  418.  
  419.   ## Altos 3068
  420.   m68*-altos-sysv* )
  421.     machine=altos opsys=usg5-2
  422.   ;;
  423.     
  424.   ## Amdahl UTS
  425.   580-amdahl-sysv* )
  426.     machine=amdahl opsys=usg5-2-2
  427.   ;;
  428.  
  429.   ## Appallings - I mean, Apollos - running Domain
  430.   m68*-apollo* )
  431.     machine=apollo opsys=bsd4-2
  432.   ;;
  433.  
  434.   ## AT&T 3b2, 3b5, 3b15, 3b20
  435.   we32k-att-sysv* )
  436.     machine=att3b opsys=usg5-2-2
  437.   ;;
  438.  
  439.   ## AT&T 3b1 - The Mighty Unix PC!
  440.   m68*-att-sysv* )
  441.     machine=7300 opsys=usg5-2-2
  442.   ;;
  443.  
  444.   ## Bull dpx2
  445.   m68*-bull-sysv3* )
  446.     machine=dpx2 opsys=usg5-3
  447.   ;;
  448.  
  449.   ## Bull sps7
  450.   m68*-bull-sysv2* )
  451.     machine=sps7 opsys=usg5-2
  452.   ;;
  453.  
  454.   ## CCI 5/32, 6/32 -- see "Tahoe".
  455.  
  456.   ## Celerity
  457.   ## I don't know what configuration name to use for this; config.sub
  458.   ## doesn't seem to know anything about it.  Hey, Celerity users, get
  459.   ## in touch with us!
  460.   celerity-celerity-bsd* )
  461.     machine=celerity opsys=bsd4-2
  462.   ;;
  463.  
  464.   ## Clipper
  465.   ## What operating systems does this chip run that Emacs has been
  466.   ## tested on?
  467.   clipper-* )
  468.     machine=clipper
  469.     ## We'll use the catch-all code at the bottom to guess the
  470.     ## operating system.
  471.   ;;
  472.  
  473.   ## Convex
  474.   *-convex-bsd* )
  475.     machine=convex opsys=bsd4-3
  476.   ;;
  477.  
  478.   ## Cubix QBx/386
  479.   i386-cubix-sysv* )
  480.     machine=intel386 opsys=usg5-3
  481.   ;;
  482.  
  483.   ## Cydra 5
  484.   cydra*-cydrome-sysv* )
  485.     machine=cydra5 opsys=usg5-3
  486.   ;;
  487.  
  488.   ## Data General AViiON Machines
  489.   m88k-dg-dgux* )
  490.     machine=aviion opsys=dgux
  491.   ;;
  492.  
  493.   ## DECstations
  494.   mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0 | mips-dec-bsd4.2 )
  495.     machine=pmax opsys=bsd4-2
  496.   ;;
  497.   mips-dec-ultrix* | mips-dec-bsd* )
  498.     machine=pmax opsys=bsd4-3
  499.   ;;
  500.   mips-dec-osf* )
  501.     machine=pmax opsys=osf1
  502.   ;;
  503.  
  504.   ## Motorola Delta machines
  505.   m68*-motorola-sysv* )
  506.     machine=delta opsys=usg5-3
  507.   ;;
  508.   m88k-motorola-sysv4* )
  509.     machine=delta88k opsys=usg5-4
  510.   ;;
  511.   m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
  512.     machine=delta88k opsys=usg5-3
  513.   ;;
  514.  
  515.   ## Dual machines
  516.   m68*-dual-sysv* )
  517.     machine=dual opsys=usg5-2
  518.   ;;
  519.   m68*-dual-uniplus* )
  520.     machine=dual opsys=unipl5-2
  521.   ;;
  522.  
  523.   ## Elxsi 6400
  524.   elxsi-elxsi-sysv* )
  525.     machine=elxsi opsys=usg5-2
  526.   ;;
  527.  
  528.   ## Encore machines
  529.   ns16k-encore-bsd* )
  530.     machine=ns16000 opsys=umax
  531.   ;;
  532.  
  533.   ## The GEC 93 - apparently, this port isn't really finished yet.
  534.  
  535.   ## Gould Power Node and NP1
  536.   pn-gould-bsd4.2 )
  537.     machine=gould opsys=bsd4-2
  538.   ;;
  539.   pn-gould-bsd4.3 )
  540.     machine=gould opsys=bsd4-3
  541.   ;;
  542.   np1-gould-bsd* )
  543.     machine=gould-np1 opsys=bsd4-3
  544.   ;;
  545.  
  546.   ## Honeywell XPS100
  547.   xps*-honeywell-sysv* )
  548.     machine=xps100 opsys=usg5-2
  549.   ;;
  550.  
  551.   ## HP 9000 series 200 or 300
  552.   m68*-hp-bsd* )
  553.     machine=hp9000s300 opsys=bsd4-3
  554.   ;;
  555.   ## HP/UX 7, 8 and 9 are supported on these machines.
  556.   m68*-hp-hpux* )
  557.     case "`uname -r`" in
  558.       *.08.* ) machine=hp9000s300 opsys=hpux8 ;;
  559.       *.09.* ) machine=hp9000s300 opsys=hpux9 ;;
  560.       *) machine=hp9000s300 opsys=hpux ;;
  561.     esac
  562.   ;;
  563.  
  564.   ## HP 9000 series 700 and 800, running HP/UX
  565.   hppa*-hp-hpux7* )
  566.     machine=hp9000s800 opsys=hpux
  567.   ;;
  568.   hppa*-hp-hpux8* )
  569.     machine=hp9000s800 opsys=hpux8
  570.   ;;
  571.   hppa*-hp-hpux9* )
  572.     machine=hp9000s800 opsys=hpux9
  573.   ;;
  574.  
  575.   ## HP 9000 series 700 and 800, running HP/UX
  576.   hppa*-hp-hpux* )
  577.     ## Cross-compilation?  Nah!
  578.     case "`uname -r`" in
  579.       *.08.* ) machine=hp9000s800 opsys=hpux8 ;;
  580.       *.09.* ) machine=hp9000s800 opsys=hpux9 ;;
  581.       *) machine=hp9000s800 opsys=hpux ;;
  582.     esac
  583.   ;;
  584.  
  585.   ## Orion machines
  586.   orion-orion-bsd* )
  587.     machine=orion opsys=bsd4-2
  588.   ;;
  589.   clipper-orion-bsd* )
  590.     machine=orion105 opsys=bsd4-2
  591.   ;;
  592.  
  593.   ## IBM machines
  594.   i386-ibm-aix1.1 )
  595.     machine=ibmps2-aix opsys=usg5-2-2
  596.   ;;
  597.   i386-ibm-aix1.[23] | i386-ibm-aix* )
  598.     machine=ibmps2-aix opsys=usg5-3
  599.   ;;
  600.   rs6000-ibm-aix3.1 )
  601.     machine=ibmrs6000 opsys=aix3-1
  602.   ;;
  603.   rs6000-ibm-aix3.2 | rs6000-ibm-aix* )
  604.     machine=ibmrs6000 opsys=aix3-2
  605.   ;;
  606.   romp-ibm-bsd4-3 )
  607.     machine=ibmrt opsys=bsd4-3
  608.   ;;    
  609.   romp-ibm-bsd4-2 )
  610.     machine=ibmrt opsys=bsd4-2
  611.   ;;
  612.   romp-ibm-aos4-3 )
  613.     machine=ibmrt opsys=bsd4-3
  614.   ;;    
  615.   romp-ibm-aos4-2 )
  616.     machine=ibmrt opsys=bsd4-2
  617.   ;;
  618.   romp-ibm-aos* )
  619.     machine=ibmrt opsys=bsd4-3
  620.   ;;
  621.   romp-ibm-bsd* )
  622.     machine=ibmrt opsys=bsd4-3
  623.   ;;
  624.   romp-ibm-aix* )
  625.     machine=ibmrt-aix opsys=usg5-2-2
  626.   ;;
  627.  
  628.   ## Integrated Solutions `Optimum V'
  629.   m68*-isi-bsd4.2 )
  630.     machine=isi-ov opsys=bsd4-2
  631.   ;;
  632.   m68*-isi-bsd4.3 )
  633.     machine=isi-ov opsys=bsd4-3
  634.   ;;
  635.  
  636.   ## Intel 386 machines where we do care about the manufacturer
  637.   i[34]86-intsys-sysv* )
  638.     machine=is386 opsys=usg5-2-2
  639.   ;;
  640.  
  641.   ## Prime EXL
  642.   i386-prime-sysv* )
  643.     machine=i386 opsys=usg5-3
  644.   ;;
  645.  
  646.   ## Sequent Symmetry
  647.   i386-sequent-bsd* )
  648.     machine=symmetry opsys=bsd4-3
  649.   ;;
  650.  
  651.   ## Intel 860
  652.   i860-*-sysvr4 )
  653.     machine=i860 opsys=usg5-4
  654.   ;;
  655.  
  656.   ## Silicon Graphics machines
  657.   ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
  658.   m68*-sgi-iris3.5 )
  659.     machine=irist opsys=iris3-5
  660.   ;;
  661.   m68*-sgi-iris3.6 | m68*-sgi-iris*)
  662.     machine=irist opsys=iris3-6
  663.   ;;
  664.   ## Iris 4D
  665.   mips-sgi-irix3.* )
  666.     machine=iris4d opsys=irix3-3
  667.   ;;
  668.   mips-sgi-irix4.* | mips-sgi-irix* )
  669.     machine=iris4d opsys=irix4-0
  670.   ;;
  671.  
  672.   ## Masscomp machines
  673.   m68*-masscomp-rtu )
  674.     machine=masscomp opsys=rtu
  675.   ;;
  676.  
  677.   ## Megatest machines
  678.   m68*-megatest-bsd* )
  679.     machine=mega68 opsys=bsd4-2
  680.   ;;
  681.  
  682.   ## Workstations sold by MIPS
  683.   ## This is not necessarily all workstations using the MIPS processor -
  684.   ## Irises are produced by SGI, and DECstations by DEC.
  685.  
  686.   ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
  687.   ## and usg5-2-2 and bsd4-3 as possible OS files.  The only guidance
  688.   ## it gives for choosing between the alternatives seems to be "Use
  689.   ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
  690.   ## the BSD world."  I'll assume that these are instructions for
  691.   ## handling two odd situations, and that every other situation
  692.   ## should use mips.h and usg5-2-2, they being listed first.
  693.   mips-mips-usg* )
  694.     machine=mips4
  695.     ## Fall through to the general code at the bottom to decide on the OS.
  696.   ;;
  697.   mips-mips-riscos4* )
  698.     machine=mips4 opsys=bsd4-3
  699.   ;;
  700.   mips-mips-bsd* )
  701.     machine=mips opsys=bsd4-3
  702.   ;;
  703.   mips-mips-* )
  704.     machine=mips opsys=usg5-2-2
  705.   ;;
  706.  
  707.   ## NeXT
  708.   m68*-next-mach* | m68*-next-bsd* )
  709.     machine=next opsys=mach2
  710.   ;;
  711.  
  712.   ## The complete machine from National Semiconductor
  713.   ns32k-ns-genix* )
  714.     machine=ns32000 opsys=usg5-2
  715.   ;;
  716.  
  717.   ## NCR machines
  718.   m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
  719.     machine=tower32 opsys=usg5-2-2
  720.   ;;
  721.   m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
  722.     machine=tower32v3 opsys=usg5-3
  723.   ;;
  724.  
  725.   ## Nixdorf Targon 31
  726.   m68*-nixdorf-sysv* )
  727.     machine=targon31 opsys=usg5-2-2
  728.   ;;
  729.  
  730.   ## Nu (TI or LMI)
  731.   m68*-nu-sysv* )
  732.     machine=nu opsys=usg5-2
  733.   ;;
  734.  
  735.   ## Plexus
  736.   m68*-plexus-sysv* )
  737.     machine=plexus opsys=usg5-2
  738.   ;;
  739.  
  740.   ## Pyramid machines
  741.   ## I don't really have any idea what sort of processor the Pyramid has,
  742.   ## so I'm assuming it is its own architecture.
  743.   pyramid-pyramid-bsd* )
  744.     machine=pyramid opsys=bsd4-2
  745.   ;;
  746.  
  747.   ## Sequent Balance
  748.   ns32k-sequent-bsd4.2 )
  749.     machine=sequent opsys=bsd4-2
  750.   ;;
  751.   ns32k-sequent-bsd4.3 )
  752.     machine=sequent opsys=bsd4-3
  753.   ;;
  754.  
  755.   ## SONY machines
  756.   m68*-sony-bsd4.2 )
  757.     machine=news opsys=bsd4-2
  758.   ;;
  759.   m68*-sony-bsd4.3 )
  760.     machine=news opsys=bsd4-3
  761.   ;;
  762.   mips-sony-bsd* )
  763.     machine=news-risc opsys=bsd4-3
  764.   ;;
  765.  
  766.   ## Stride
  767.   m68*-stride-sysv* )
  768.     machine=stride opsys=usg5-2
  769.   ;;
  770.  
  771.   ## Suns
  772.   *-sun-sunos* | *-sun-bsd* | *-sun-solaris* )
  773.     case "${configuration}" in
  774.       m68*-sunos1* )    machine=sun1 ;;
  775.       m68*-sunos2* )    machine=sun2 ;;
  776.       m68* )        machine=sun3 ;;
  777.       i[34]86* )    machine=sun386 ;;
  778.       sparc* )        machine=sparc ;;
  779.       * )        unported=true ;;
  780.     esac
  781.     case "${configuration}" in
  782.       *-sunos4.0*      ) opsys=sunos4-0 ;;
  783.       *-sunos4.1.3*      ) opsys=sunos4-1-3 ;;
  784.       *-sunos4* | *-sunos ) opsys=sunos4-1 ;;
  785.       *-sunos5* | *-solaris* ) opsys=sol2 ;;
  786.       *              ) opsys=bsd4-2   ;;
  787.     esac
  788.   ;;
  789.  
  790.   ## Tadpole 68k
  791.   m68*-tadpole-sysv* )
  792.     machine=tad68k opsys=usg5-3
  793.   ;;
  794.  
  795.   ## Tahoe machines
  796.   tahoe-tahoe-bsd4.2 )
  797.     machine=tahoe opsys=bsd4-2
  798.   ;;
  799.   tahoe-tahoe-bsd4.3 )
  800.     machine=tahoe opsys=bsd4-3
  801.   ;;
  802.  
  803.   ## Tandem Integrity S2
  804.   mips-tandem-sysv* )
  805.     machine=tandem-s2 opsys=usg5-3
  806.   ;;
  807.  
  808.   ## Tektronix XD88
  809.   m88k-tektronix-sysv3 )
  810.   machine=tekXD88 opsys=usg5-3
  811.   ;;
  812.  
  813.   ## Tektronix 16000 box (6130?)
  814.   ns16k-tektronix-bsd* )
  815.     machine=ns16000 opsys=bsd4-2
  816.   ;;
  817.   ## Tektronix 4300
  818.   ## src/m/tek4300.h hints that this is a m68k machine.
  819.   m68*-tektronix-bsd* )
  820.     machine=tex4300 opsys=bsd4-3
  821.   ;;
  822.  
  823.   ## Titan P2 or P3
  824.   ## We seem to have lost the machine-description file titan.h!
  825.   titan-titan-sysv* )
  826.     machine=titan opsys=usg5-3
  827.   ;;
  828.   
  829.   ## Ustation E30 (SS5E)
  830.   m68*-unisys-uniplus* )
  831.     machine=ustation opsystem=unipl5-2
  832.   ;;
  833.  
  834.   ## Vaxen.
  835.   vax-dec-* )
  836.     machine=vax
  837.     case "${configuration}" in
  838.       *-bsd4.1 )                     opsys=bsd4-1 ;;
  839.       *-bsd4.2 | *-ultrix[0-3].* | *-ultrix4.0 )    opsys=bsd4-2 ;;
  840.       *-bsd4.3 | *-ultrix* )                 opsys=bsd4-3 ;;
  841.       *-bsd386 )                    opsys=bsd386 ;;
  842.       *-sysv[01]* | *-sysvr[01]* )             opsys=usg5-0 ;;
  843.       *-sysv2* | *-sysvr2* )                opsys=usg5-2 ;;
  844.       *-vms* )                         opsys=vms ;;
  845.       * )                         unported=true
  846.     esac
  847.   ;;
  848.  
  849.   ## Whitechapel MG1
  850.   ns16k-whitechapel-* )
  851.     machine=mg1
  852.     ## We don't know what sort of OS runs on these; we'll let the
  853.     ## operating system guessing code below try.
  854.   ;;
  855.  
  856.   ## Wicat
  857.   m68*-wicat-sysv* )
  858.     machine=wicat opsys=usg5-2
  859.   ;;
  860.  
  861.   ## Intel 386 machines where we don't care about the manufacturer
  862.   i[34]86-*-* )
  863.     machine=intel386
  864.     case "${configuration}" in
  865.       *-isc1.* | *-isc2.[01]* )    opsys=386-ix ;;
  866.       *-isc2.2 )        opsys=isc2-2 ;;
  867.       *-isc* )            opsys=isc3-0 ;;
  868.       *-esix5* )        opsys=esix5r4 ;;
  869.       *-esix* )            opsys=esix ;;
  870.       *-xenix* )        opsys=xenix ;;
  871.       *-linux* )        opsys=linux ;;
  872.       *-sco3.2v4* )        opsys=sco4 ;;
  873.       *-bsd386* )        opsys=bsd386 ;;
  874.       *-386bsd )            opsys=386bsd ;;
  875.       ## Otherwise, we'll fall through to the generic opsys code at the bottom.
  876.     esac
  877.   ;;
  878.  
  879.   * )
  880.     unported=true
  881.   ;;
  882. esac
  883.  
  884. ### If the code above didn't choose an operating system, just choose
  885. ### an operating system based on the configuration name.  You really
  886. ### only want to use this when you have no idea what the right
  887. ### operating system is; if you know what operating systems a machine
  888. ### runs, it's cleaner to make it explicit in the case statement
  889. ### above.
  890. if [ x"${opsys}" = x ]; then
  891.   case "${configuration}" in
  892.     *-bsd4.[01] )    opsys=bsd4-1 ;;
  893.     *-bsd4.2 )        opsys=bsd4-2 ;;
  894.     *-bsd4.3 )        opsys=bsd4-3 ;;
  895.     *-sysv0 | *-sysvr0 )        opsys=usg5-0 ;;
  896.     *-sysv2 | *-sysvr2 )        opsys=usg5-2 ;;
  897.     *-sysv2.2 | *-sysvr2.2 )        opsys=usg5-2-2 ;;
  898.     *-sysv3 | *-sysvr3 )        opsys=usg5-3 ;;
  899.     *-sysv4 | *-sysvr4 )        opsys=usg5-4 ;;
  900.     *-sysv4.2 | *-sysvr4.2 )        opsys=usg5-4-2 ;;
  901.     * )
  902.       unported=true
  903.     ;;
  904.   esac
  905. fi
  906.  
  907. if $unported ; then
  908.   (echo "${progname}: Emacs hasn't been ported to \`${configuration}' systems."
  909.    echo "${progname}: Check \`etc/MACHINES' for recognized configuration names."
  910.   ) >&2
  911.   exit 1
  912. fi
  913.  
  914. machfile="m/${machine}.h"
  915. opsysfile="s/${opsys}.h"
  916.  
  917.  
  918. trap 'rm -fr conftest* core; exit 1' 1 3 15
  919.  
  920. # NLS nuisances.
  921. # These must not be set unconditionally because not all systems understand
  922. # e.g. LANG=C (notably SCO).
  923. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  924. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  925.  
  926. rm -f conftest*
  927. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  928.  
  929. # A filename unique to this package, relative to the directory that
  930. # configure is in, which we can look for to find out if srcdir is correct.
  931. unique_file=lisp
  932.  
  933. # Find the source files, if location was not specified.
  934. if test -z "$srcdir"; then
  935.   srcdirdefaulted=yes
  936.   # Try the directory containing this script, then `..'.
  937.   prog=$0
  938.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  939.   test "X$confdir" = "X$prog" && confdir=.
  940.   srcdir=$confdir
  941.   if test ! -r $srcdir/$unique_file; then
  942.     srcdir=..
  943.   fi
  944. fi
  945. if test ! -r $srcdir/$unique_file; then
  946.   if test x$srcdirdefaulted = xyes; then
  947.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  948.   else
  949.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  950.   fi
  951.   exit 1
  952. fi
  953. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  954. # But we can't avoid them for `..', to make subdirectories work.
  955. case $srcdir in
  956.   .|/*|~*) ;;
  957.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  958. esac
  959.  
  960. # Save the original args to write them into config.status later.
  961. configure_args="$*"
  962.  
  963.  
  964.  
  965.  
  966. #### Choose a compiler.
  967. case ${with_gcc} in
  968.   "yes" ) CC="gcc" GCC=1 ;;
  969.   "no"  ) CC="cc"        ;;
  970.   * )
  971.      if test -z "$CC"; then
  972.   # Extract the first word of `gcc', so it can be a program name with args.
  973.   set dummy gcc; word=$2
  974.   echo checking for $word
  975.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  976.   for dir in $PATH; do
  977.     test -z "$dir" && dir=.
  978.     if test -f $dir/$word; then
  979.       CC="gcc"
  980.       break
  981.     fi
  982.   done
  983.   IFS="$saveifs"
  984. fi
  985. test -z "$CC" && CC="cc"
  986. test -n "$CC" -a -n "$verbose" && echo "    setting CC to $CC"
  987.  
  988. # Find out if we are using GNU C, under whatever name.
  989. cat > conftest.c <<EOF
  990. #ifdef __GNUC__
  991.   yes
  992. #endif
  993. EOF
  994. ${CC-cc} -E conftest.c > conftest.out 2>&1
  995. if egrep yes conftest.out >/dev/null 2>&1; then
  996.   GCC=1 # For later tests.
  997. fi
  998. rm -f conftest*
  999.  
  1000. esac
  1001.  
  1002. #### Some other nice autoconf tests.  If you add a test here which
  1003. #### should make an entry in src/config.h, don't forget to add an
  1004. #### #undef clause to src/config.h.in for autoconf to modify.
  1005.  
  1006. echo checking for ln -s
  1007. rm -f conftestdata
  1008. if ln -s X conftestdata 2>/dev/null
  1009. then
  1010.   rm -f conftestdata
  1011.   LN_S="ln -s"
  1012. else
  1013.   LN_S=ln
  1014. fi
  1015.  
  1016.  
  1017. echo checking how to run the C preprocessor
  1018. if test -z "$CPP"; then
  1019.   # This must be in double quotes, not single quotes, because CPP may get
  1020.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  1021.   # make.  It must be expanded now.
  1022.   CPP="${CC-cc} -E"
  1023.   cat > conftest.c <<EOF
  1024. #include <stdio.h>
  1025. Syntax Error
  1026. EOF
  1027. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  1028. if test -z "$err"; then
  1029.   :
  1030. else
  1031.   CPP=/lib/cpp
  1032. fi
  1033. rm -f conftest*
  1034. fi
  1035. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  1036.  
  1037. # Make sure to not get the incompatible SysV /etc/install and
  1038. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  1039. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  1040. # or the AFS install, which mishandles nonexistent args, or
  1041. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  1042. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  1043. # anyway.  Sigh.
  1044. if test "z${INSTALL}" = "z" ; then
  1045.   echo checking for install
  1046.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  1047.   for dir in $PATH; do
  1048.     test -z "$dir" && dir=.
  1049.     case $dir in
  1050.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  1051.     *)
  1052.       if test -f $dir/installbsd; then
  1053.     INSTALL="$dir/installbsd -c" # OSF1
  1054.     INSTALL_PROGRAM='$(INSTALL)'
  1055.     INSTALL_DATA='$(INSTALL) -m 644'
  1056.     break
  1057.       fi
  1058.       if test -f $dir/install; then
  1059.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  1060.       : # AIX
  1061.     else
  1062.       INSTALL="$dir/install -c"
  1063.       INSTALL_PROGRAM='$(INSTALL)'
  1064.       INSTALL_DATA='$(INSTALL) -m 644'
  1065.       break
  1066.     fi
  1067.       fi
  1068.       ;;
  1069.     esac
  1070.   done
  1071.   IFS="$saveifs"
  1072. fi
  1073. INSTALL=${INSTALL-cp}
  1074. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  1075. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  1076.  
  1077. for p in 'bison -y' byacc
  1078. do
  1079. if test -z "$YACC"; then
  1080.   # Extract the first word of `$p', so it can be a program name with args.
  1081.   set dummy $p; word=$2
  1082.   echo checking for $word
  1083.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  1084.   for dir in $PATH; do
  1085.     test -z "$dir" && dir=.
  1086.     if test -f $dir/$word; then
  1087.       YACC="$p"
  1088.       break
  1089.     fi
  1090.   done
  1091.   IFS="$saveifs"
  1092. fi
  1093.  
  1094. test -n "$YACC" -a -n "$verbose" && echo "    setting YACC to $YACC"
  1095.  
  1096. test -n "$YACC" && break
  1097. done
  1098. test -n "$YACC" || YACC="yacc"
  1099.  
  1100.  
  1101.  
  1102. for hdr in sys/timeb.h sys/time.h
  1103. do
  1104. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  1105. echo checking for ${hdr}
  1106. cat > conftest.c <<EOF
  1107. #include <${hdr}>
  1108. EOF
  1109. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  1110. if test -z "$err"; then
  1111.   {
  1112. test -n "$verbose" && \
  1113. echo '    defining' ${trhdr}
  1114. DEFS="$DEFS -D${trhdr}=1"
  1115. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  1116. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  1117. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  1118. "
  1119. }
  1120.  
  1121. fi
  1122. rm -f conftest*
  1123. done
  1124.  
  1125. echo checking for ANSI C header files
  1126. cat > conftest.c <<EOF
  1127. #include <stdlib.h>
  1128. #include <stdarg.h>
  1129. #include <string.h>
  1130. #include <float.h>
  1131. EOF
  1132. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  1133. if test -z "$err"; then
  1134.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  1135. echo '#include <string.h>' > conftest.c
  1136. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  1137. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  1138.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  1139. cat > conftest.c <<EOF
  1140. #include <ctype.h>
  1141. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  1142. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  1143. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  1144. int main () { int i; for (i = 0; i < 256; i++)
  1145. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  1146. exit (0); }
  1147.  
  1148. EOF
  1149. eval $compile
  1150. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1151.   {
  1152. test -n "$verbose" && \
  1153. echo '    defining' STDC_HEADERS
  1154. DEFS="$DEFS -DSTDC_HEADERS=1"
  1155. SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
  1156. \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
  1157. \${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
  1158. "
  1159. }
  1160.  
  1161. fi
  1162. rm -f conftest*
  1163. fi
  1164. rm -f conftest*
  1165.  
  1166. fi
  1167. rm -f conftest*
  1168.  
  1169. echo checking for whether time.h and sys/time.h may both be included
  1170. cat > conftest.c <<EOF
  1171. #include <sys/types.h>
  1172. #include <sys/time.h>
  1173. #include <time.h>
  1174. int main() { exit(0); }
  1175. int t() { struct tm *tp; }
  1176. EOF
  1177. if eval $compile; then
  1178.   {
  1179. test -n "$verbose" && \
  1180. echo '    defining' TIME_WITH_SYS_TIME
  1181. DEFS="$DEFS -DTIME_WITH_SYS_TIME=1"
  1182. SEDDEFS="${SEDDEFS}\${SEDdA}TIME_WITH_SYS_TIME\${SEDdB}TIME_WITH_SYS_TIME\${SEDdC}1\${SEDdD}
  1183. \${SEDuA}TIME_WITH_SYS_TIME\${SEDuB}TIME_WITH_SYS_TIME\${SEDuC}1\${SEDuD}
  1184. \${SEDeA}TIME_WITH_SYS_TIME\${SEDeB}TIME_WITH_SYS_TIME\${SEDeC}1\${SEDeD}
  1185. "
  1186. }
  1187.  
  1188. fi
  1189. rm -f conftest*
  1190.  
  1191.  
  1192. LIBS_save="${LIBS}"
  1193. LIBS="${LIBS} -ldnet"
  1194. have_lib=""
  1195. echo checking for -ldnet
  1196. cat > conftest.c <<EOF
  1197.  
  1198. int main() { exit(0); }
  1199. int t() { main(); }
  1200. EOF
  1201. if eval $compile; then
  1202.   have_lib="1"
  1203. fi
  1204. rm -f conftest*
  1205. LIBS="${LIBS_save}"
  1206. if test -n "${have_lib}"; then
  1207.    {
  1208. test -n "$verbose" && \
  1209. echo '    defining' HAVE_LIBDNET
  1210. DEFS="$DEFS -DHAVE_LIBDNET=1"
  1211. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBDNET\${SEDdB}HAVE_LIBDNET\${SEDdC}1\${SEDdD}
  1212. \${SEDuA}HAVE_LIBDNET\${SEDuB}HAVE_LIBDNET\${SEDuC}1\${SEDuD}
  1213. \${SEDeA}HAVE_LIBDNET\${SEDeB}HAVE_LIBDNET\${SEDeC}1\${SEDeD}
  1214. "
  1215. }
  1216.  
  1217.    LIBS="${LIBS} -ldnet"
  1218. fi
  1219.  
  1220.  
  1221. echo checking for return type of signal handlers
  1222. cat > conftest.c <<EOF
  1223. #include <sys/types.h>
  1224. #include <signal.h>
  1225. #ifdef signal
  1226. #undef signal
  1227. #endif
  1228. extern void (*signal ()) ();
  1229. int main() { exit(0); }
  1230. int t() { int i; }
  1231. EOF
  1232. if eval $compile; then
  1233.   {
  1234. test -n "$verbose" && \
  1235. echo '    defining' RETSIGTYPE to be 'void'
  1236. DEFS="$DEFS -DRETSIGTYPE=void"
  1237. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
  1238. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
  1239. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
  1240. "
  1241. }
  1242.  
  1243. else
  1244.   {
  1245. test -n "$verbose" && \
  1246. echo '    defining' RETSIGTYPE to be 'int'
  1247. DEFS="$DEFS -DRETSIGTYPE=int"
  1248. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
  1249. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
  1250. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
  1251. "
  1252. }
  1253.  
  1254. fi
  1255. rm -f conftest*
  1256.  
  1257.  
  1258.  
  1259. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  1260. # for constant arguments.  Useless!
  1261. echo checking for working alloca.h
  1262. cat > conftest.c <<EOF
  1263. #include <alloca.h>
  1264. int main() { exit(0); }
  1265. int t() { char *p = alloca(2 * sizeof(int)); }
  1266. EOF
  1267. if eval $compile; then
  1268.   {
  1269. test -n "$verbose" && \
  1270. echo '    defining' HAVE_ALLOCA_H
  1271. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  1272. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ALLOCA_H\${SEDdB}HAVE_ALLOCA_H\${SEDdC}1\${SEDdD}
  1273. \${SEDuA}HAVE_ALLOCA_H\${SEDuB}HAVE_ALLOCA_H\${SEDuC}1\${SEDuD}
  1274. \${SEDeA}HAVE_ALLOCA_H\${SEDeB}HAVE_ALLOCA_H\${SEDeC}1\${SEDeD}
  1275. "
  1276. }
  1277.  
  1278. fi
  1279. rm -f conftest*
  1280.  
  1281. decl="#ifdef __GNUC__
  1282. #define alloca __builtin_alloca
  1283. #else
  1284. #if HAVE_ALLOCA_H
  1285. #include <alloca.h>
  1286. #else
  1287. #ifdef _AIX
  1288.  #pragma alloca
  1289. #else
  1290. char *alloca ();
  1291. #endif
  1292. #endif
  1293. #endif
  1294. "
  1295. echo checking for alloca
  1296. cat > conftest.c <<EOF
  1297. $decl
  1298. int main() { exit(0); }
  1299. int t() { char *p = (char *) alloca(1); }
  1300. EOF
  1301. if eval $compile; then
  1302.   :
  1303. else
  1304.   alloca_missing=1
  1305. cat > conftest.c <<EOF
  1306.  
  1307. #if defined(CRAY) && ! defined(CRAY2)
  1308. winnitude
  1309. #else
  1310. lossage
  1311. #endif
  1312.  
  1313. EOF
  1314. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  1315. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  1316.   echo checking for _getb67
  1317. cat > conftest.c <<EOF
  1318. #include <ctype.h>
  1319. int main() { exit(0); }
  1320. int t() { 
  1321. /* The GNU C library defines this for functions which it implements
  1322.     to always fail with ENOSYS.  Some functions are actually named
  1323.     something starting with __ and the normal name is an alias.  */
  1324. #if defined (__stub__getb67) || defined (__stub____getb67)
  1325. choke me
  1326. #else
  1327. /* Override any gcc2 internal prototype to avoid an error.  */
  1328. extern char _getb67(); _getb67();
  1329. #endif
  1330.  }
  1331. EOF
  1332. if eval $compile; then
  1333.   {
  1334. test -n "$verbose" && \
  1335. echo '    defining' CRAY_STACKSEG_END to be '_getb67'
  1336. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  1337. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}_getb67\${SEDdD}
  1338. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}_getb67\${SEDuD}
  1339. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}_getb67\${SEDeD}
  1340. "
  1341. }
  1342.  
  1343. else
  1344.   echo checking for GETB67
  1345. cat > conftest.c <<EOF
  1346. #include <ctype.h>
  1347. int main() { exit(0); }
  1348. int t() { 
  1349. /* The GNU C library defines this for functions which it implements
  1350.     to always fail with ENOSYS.  Some functions are actually named
  1351.     something starting with __ and the normal name is an alias.  */
  1352. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  1353. choke me
  1354. #else
  1355. /* Override any gcc2 internal prototype to avoid an error.  */
  1356. extern char GETB67(); GETB67();
  1357. #endif
  1358.  }
  1359. EOF
  1360. if eval $compile; then
  1361.   {
  1362. test -n "$verbose" && \
  1363. echo '    defining' CRAY_STACKSEG_END to be 'GETB67'
  1364. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  1365. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}GETB67\${SEDdD}
  1366. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}GETB67\${SEDuD}
  1367. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}GETB67\${SEDeD}
  1368. "
  1369. }
  1370.  
  1371. else
  1372.   echo checking for getb67
  1373. cat > conftest.c <<EOF
  1374. #include <ctype.h>
  1375. int main() { exit(0); }
  1376. int t() { 
  1377. /* The GNU C library defines this for functions which it implements
  1378.     to always fail with ENOSYS.  Some functions are actually named
  1379.     something starting with __ and the normal name is an alias.  */
  1380. #if defined (__stub_getb67) || defined (__stub___getb67)
  1381. choke me
  1382. #else
  1383. /* Override any gcc2 internal prototype to avoid an error.  */
  1384. extern char getb67(); getb67();
  1385. #endif
  1386.  }
  1387. EOF
  1388. if eval $compile; then
  1389.   {
  1390. test -n "$verbose" && \
  1391. echo '    defining' CRAY_STACKSEG_END to be 'getb67'
  1392. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  1393. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}getb67\${SEDdD}
  1394. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}getb67\${SEDuD}
  1395. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}getb67\${SEDeD}
  1396. "
  1397. }
  1398.  
  1399. fi
  1400. rm -f conftest*
  1401.  
  1402. fi
  1403. rm -f conftest*
  1404.  
  1405. fi
  1406. rm -f conftest*
  1407.  
  1408. fi
  1409. rm -f conftest*
  1410.  
  1411.  
  1412. fi
  1413. rm -f conftest*
  1414.  
  1415. if test -n "$alloca_missing"; then
  1416.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  1417.   # that cause trouble.  Some versions do not even contain alloca or
  1418.   # contain a buggy version.  If you still want to use their alloca,
  1419.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  1420.   ALLOCA=alloca.o
  1421.  
  1422.   echo 'checking stack direction for C alloca'
  1423.   echo checking whether cross-compiling
  1424. # If we cannot run a trivial program, we must be cross compiling.
  1425. cat > conftest.c <<EOF
  1426. main(){exit(0);}
  1427. EOF
  1428. eval $compile
  1429. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1430.   :
  1431. else
  1432.   cross_compiling=1
  1433. fi
  1434. rm -f conftest*
  1435.  
  1436. if test -n "$cross_compiling"
  1437. then
  1438.   {
  1439. test -n "$verbose" && \
  1440. echo '    defining' STACK_DIRECTION to be '0'
  1441. DEFS="$DEFS -DSTACK_DIRECTION=0"
  1442. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}0\${SEDdD}
  1443. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}0\${SEDuD}
  1444. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}0\${SEDeD}
  1445. "
  1446. }
  1447.  
  1448. else
  1449. cat > conftest.c <<EOF
  1450. find_stack_direction ()
  1451. {
  1452.   static char *addr = 0;
  1453.   auto char dummy;
  1454.   if (addr == 0)
  1455.     {
  1456.       addr = &dummy;
  1457.       return find_stack_direction ();
  1458.     }
  1459.   else
  1460.     return (&dummy > addr) ? 1 : -1;
  1461. }
  1462. main ()
  1463. {
  1464.   exit (find_stack_direction() < 0);
  1465. }
  1466. EOF
  1467. eval $compile
  1468. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1469.   {
  1470. test -n "$verbose" && \
  1471. echo '    defining' STACK_DIRECTION to be '1'
  1472. DEFS="$DEFS -DSTACK_DIRECTION=1"
  1473. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}1\${SEDdD}
  1474. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}1\${SEDuD}
  1475. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}1\${SEDeD}
  1476. "
  1477. }
  1478.  
  1479. else
  1480.   {
  1481. test -n "$verbose" && \
  1482. echo '    defining' STACK_DIRECTION to be '-1'
  1483. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  1484. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}-1\${SEDdD}
  1485. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}-1\${SEDuD}
  1486. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}-1\${SEDeD}
  1487. "
  1488. }
  1489.  
  1490. fi
  1491. fi
  1492. rm -f conftest*
  1493. fi
  1494.  
  1495. for func in gettimeofday gethostname dup2 rename closedir
  1496. do
  1497. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  1498. echo checking for ${func}
  1499. cat > conftest.c <<EOF
  1500. #include <ctype.h>
  1501. int main() { exit(0); }
  1502. int t() { 
  1503. /* The GNU C library defines this for functions which it implements
  1504.     to always fail with ENOSYS.  Some functions are actually named
  1505.     something starting with __ and the normal name is an alias.  */
  1506. #if defined (__stub_${func}) || defined (__stub___${func})
  1507. choke me
  1508. #else
  1509. /* Override any gcc2 internal prototype to avoid an error.  */
  1510. extern char ${func}(); ${func}();
  1511. #endif
  1512.  }
  1513. EOF
  1514. if eval $compile; then
  1515.   {
  1516. test -n "$verbose" && \
  1517. echo '    defining' ${trfunc}
  1518. DEFS="$DEFS -D${trfunc}=1"
  1519. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  1520. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  1521. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  1522. "
  1523. }
  1524.  
  1525. fi
  1526. rm -f conftest*
  1527. done
  1528.  
  1529.  
  1530. echo checking for struct tm in time.h
  1531. cat > conftest.c <<EOF
  1532. #include <sys/types.h>
  1533. #include <time.h>
  1534. int main() { exit(0); }
  1535. int t() { struct tm *tp; }
  1536. EOF
  1537. if eval $compile; then
  1538.   :
  1539. else
  1540.   {
  1541. test -n "$verbose" && \
  1542. echo '    defining' TM_IN_SYS_TIME
  1543. DEFS="$DEFS -DTM_IN_SYS_TIME=1"
  1544. SEDDEFS="${SEDDEFS}\${SEDdA}TM_IN_SYS_TIME\${SEDdB}TM_IN_SYS_TIME\${SEDdC}1\${SEDdD}
  1545. \${SEDuA}TM_IN_SYS_TIME\${SEDuB}TM_IN_SYS_TIME\${SEDuC}1\${SEDuD}
  1546. \${SEDeA}TM_IN_SYS_TIME\${SEDeB}TM_IN_SYS_TIME\${SEDeC}1\${SEDeD}
  1547. "
  1548. }
  1549.  
  1550. fi
  1551. rm -f conftest*
  1552.  
  1553. decl='#include <sys/types.h>
  1554. '
  1555. case "$DEFS" in
  1556.   *TM_IN_SYS_TIME*) decl="$decl
  1557. #include <sys/time.h>
  1558. " ;;
  1559.   *) decl="$decl
  1560. #include <time.h>
  1561. " ;;
  1562. esac
  1563. echo checking for tm_zone in struct tm
  1564. cat > conftest.c <<EOF
  1565. $decl
  1566. int main() { exit(0); }
  1567. int t() { struct tm tm; tm.tm_zone; }
  1568. EOF
  1569. if eval $compile; then
  1570.   {
  1571. test -n "$verbose" && \
  1572. echo '    defining' HAVE_TM_ZONE
  1573. DEFS="$DEFS -DHAVE_TM_ZONE=1"
  1574. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TM_ZONE\${SEDdB}HAVE_TM_ZONE\${SEDdC}1\${SEDdD}
  1575. \${SEDuA}HAVE_TM_ZONE\${SEDuB}HAVE_TM_ZONE\${SEDuC}1\${SEDuD}
  1576. \${SEDeA}HAVE_TM_ZONE\${SEDeB}HAVE_TM_ZONE\${SEDeC}1\${SEDeD}
  1577. "
  1578. }
  1579.  
  1580. else
  1581.   no_tm_zone=1
  1582. fi
  1583. rm -f conftest*
  1584.  
  1585. if test -n "$no_tm_zone"; then
  1586. echo checking for tzname
  1587. cat > conftest.c <<EOF
  1588. #include <time.h>
  1589. #ifndef tzname /* For SGI.  */
  1590. extern char *tzname[]; /* RS6000 and others want it this way.  */
  1591. #endif
  1592. int main() { exit(0); }
  1593. int t() { atoi(*tzname); }
  1594. EOF
  1595. if eval $compile; then
  1596.   {
  1597. test -n "$verbose" && \
  1598. echo '    defining' HAVE_TZNAME
  1599. DEFS="$DEFS -DHAVE_TZNAME=1"
  1600. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TZNAME\${SEDdB}HAVE_TZNAME\${SEDdC}1\${SEDdD}
  1601. \${SEDuA}HAVE_TZNAME\${SEDuB}HAVE_TZNAME\${SEDuC}1\${SEDuD}
  1602. \${SEDeA}HAVE_TZNAME\${SEDeB}HAVE_TZNAME\${SEDeC}1\${SEDeD}
  1603. "
  1604. }
  1605.  
  1606. fi
  1607. rm -f conftest*
  1608.  
  1609. fi
  1610.  
  1611.  
  1612. prog='/* Ultrix mips cc rejects this.  */
  1613. typedef int charset[2]; const charset x;
  1614. /* SunOS 4.1.1 cc rejects this.  */
  1615. char const *const *ccp;
  1616. char **p;
  1617. /* AIX XL C 1.02.0.0 rejects this.
  1618.    It does not let you subtract one const X* pointer from another in an arm
  1619.    of an if-expression whose if-part is not a constant expression */
  1620. const char *g = "string";
  1621. ccp = &g + (g ? g-g : 0);
  1622. /* HPUX 7.0 cc rejects these. */
  1623. ++ccp;
  1624. p = (char**) ccp;
  1625. ccp = (char const *const *) p;
  1626. { /* SCO 3.2v4 cc rejects this.  */
  1627.   char *t;
  1628.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  1629.  
  1630.   *t++ = 0;
  1631. }
  1632. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  1633.   int x[] = {25,17};
  1634.   const int *foo = &x[0];
  1635.   ++foo;
  1636. }
  1637. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  1638.   typedef const int *iptr;
  1639.   iptr p = 0;
  1640.   ++p;
  1641. }
  1642. { /* AIX XL C 1.02.0.0 rejects this saying
  1643.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  1644.   struct s { int j; const int *ap[3]; };
  1645.   struct s *b; b->j = 5;
  1646. }'
  1647. echo checking for working const
  1648. cat > conftest.c <<EOF
  1649.  
  1650. int main() { exit(0); }
  1651. int t() { $prog }
  1652. EOF
  1653. if eval $compile; then
  1654.   :
  1655. else
  1656.   {
  1657. test -n "$verbose" && \
  1658. echo '    defining' const to be 'empty'
  1659. DEFS="$DEFS -Dconst="
  1660. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  1661. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  1662. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  1663. "
  1664. }
  1665.  
  1666. fi
  1667. rm -f conftest*
  1668.  
  1669.  
  1670. echo checking for long file names
  1671. lost=false
  1672. # Test for long file names in all the places we know might matter:
  1673. #      .        the current directory, where building will happen
  1674. #      /tmp        where it might want to write temporary files
  1675. #      /usr/tmp        likewise
  1676. #      $prefix        where we will be installing things
  1677. #      $exec_prefix    likewise
  1678. for dir in . /tmp /usr/tmp $prefix $exec_prefix ; do
  1679.   (echo 1 > $dir/conftest9012345) 2>/dev/null
  1680.   (echo 2 > $dir/conftest9012346) 2>/dev/null
  1681.   val=`cat $dir/conftest9012345 2>/dev/null`
  1682.   test -f $dir/conftest9012345 && test "$val" = 1 || lost=true
  1683.   rm -f $dir/conftest9012345 $dir/conftest9012346 2> /dev/null
  1684. done
  1685. $lost || {
  1686. test -n "$verbose" && \
  1687. echo '    defining' HAVE_LONG_FILE_NAMES
  1688. DEFS="$DEFS -DHAVE_LONG_FILE_NAMES=1"
  1689. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LONG_FILE_NAMES\${SEDdB}HAVE_LONG_FILE_NAMES\${SEDdC}1\${SEDdD}
  1690. \${SEDuA}HAVE_LONG_FILE_NAMES\${SEDuB}HAVE_LONG_FILE_NAMES\${SEDuC}1\${SEDuD}
  1691. \${SEDeA}HAVE_LONG_FILE_NAMES\${SEDeB}HAVE_LONG_FILE_NAMES\${SEDeC}1\${SEDeD}
  1692. "
  1693. }
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700. #### Choose a window system.
  1701. echo "Checking window system."
  1702.  
  1703. window_system=''
  1704. case "${with_x}" in
  1705.   yes )
  1706.     window_system=${window_system}x11
  1707.   ;;
  1708.   no )
  1709.     window_system=${window_system}none
  1710. esac
  1711. case "${with_x11}" in
  1712.   yes )
  1713.     window_system=${window_system}x11
  1714.   ;;
  1715. esac
  1716. case "${with_x10}" in
  1717.   yes )
  1718.     window_system=${window_system}x10
  1719.   ;;
  1720. esac
  1721.  
  1722. ### If the user hasn't specified where we should find X, try
  1723. ### letting autoconf figure that out.
  1724. if [ "0${x_includes}" == 0 ] && [ "0${x_libraries}" == 0 ]; then
  1725.   
  1726.     # If we find X, set shell vars x_includes and x_libraries to the paths.
  1727. echo checking for X include and library files with xmkmf
  1728. rm -fr conftestdir
  1729. if mkdir conftestdir; then
  1730.   cd conftestdir
  1731.   cat < /dev/null > Imakefile
  1732.   if xmkmf >/dev/null 2>/dev/null && test -f Makefile; then
  1733.     eval `sed -n \
  1734.     -e 's,.* INCROOT *=[^/]*,x_includes=,p' \
  1735.     -e 's,.* USRLIBDIR *=[^/]*,x_libraries=,p' \
  1736.     Makefile`
  1737.   fi
  1738.   cd ..
  1739.   rm -fr conftestdir
  1740. fi
  1741.  
  1742.   
  1743. fi
  1744.  
  1745. case "${window_system}" in
  1746.   "none" | "x11" | "x10" ) ;;
  1747.   "" )
  1748.     echo "  No window system specified.  Looking for X11."
  1749.     window_system=none
  1750.     if [ -r /usr/lib/libX11.a \
  1751.      -o -d /usr/include/X11 \
  1752.          -o -d /usr/X386/include \
  1753.      -o -d ${x_includes}/X11 ]; then
  1754.       window_system=x11
  1755.     fi
  1756.   ;;
  1757.   * )
  1758.     echo "Don't specify the window system more than once." >&2
  1759.     exit 1
  1760.   ;;
  1761. esac
  1762.  
  1763. case "${window_system}" in
  1764.   x11 )
  1765.     HAVE_X_WINDOWS=yes
  1766.     HAVE_X11=yes
  1767.     echo "  Using X11."
  1768.   ;;
  1769.   x10 )
  1770.     HAVE_X_WINDOWS=yes
  1771.     HAVE_X11=no
  1772.     echo "  Using X10."
  1773.   ;;
  1774.   none )
  1775.     HAVE_X_WINDOWS=no
  1776.     HAVE_X11=no
  1777.     echo "  Using no window system."
  1778.   ;;
  1779. esac
  1780.  
  1781. ### If we're using X11, we should use the X menu package.
  1782. HAVE_X_MENU=no
  1783. case ${HAVE_X11} in
  1784.   yes )
  1785.     HAVE_X_MENU=yes
  1786.   ;;
  1787. esac
  1788.  
  1789. #### Extract some information from the operating system and machine files.
  1790.  
  1791. echo "Examining the machine- and system-dependent files to find out"
  1792. echo " - which libraries the lib-src programs will want, and"
  1793. echo " - whether the GNU malloc routines are usable."
  1794.  
  1795. ### It's not important that this name contain the PID; you can't run
  1796. ### two configures in the same directory and have anything work
  1797. ### anyway.
  1798. tempcname="conftest.c"
  1799.  
  1800. echo '
  1801. #include "'${srcdir}'/src/'${opsysfile}'"
  1802. #include "'${srcdir}'/src/'${machfile}'"
  1803. #ifndef LIBS_MACHINE
  1804. #define LIBS_MACHINE
  1805. #endif
  1806. #ifndef LIBS_SYSTEM
  1807. #define LIBS_SYSTEM
  1808. #endif
  1809. #ifndef C_SWITCH_SYSTEM
  1810. #define C_SWITCH_SYSTEM
  1811. #endif
  1812. @configure@ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
  1813. @configure@ c_switch_system=C_SWITCH_SYSTEM
  1814.  
  1815. #ifdef UNEXEC
  1816. @configure@ unexec=UNEXEC
  1817. #else
  1818. @configure@ unexec=unexec.o
  1819. #endif
  1820.  
  1821. #ifdef SYSTEM_MALLOC
  1822. @configure@ system_malloc=yes
  1823. #else
  1824. @configure@ system_malloc=no
  1825. #endif
  1826.  
  1827. #ifndef C_DEBUG_SWITCH
  1828. #define C_DEBUG_SWITCH -g
  1829. #endif
  1830.  
  1831. #ifndef C_OPTIMIZE_SWITCH
  1832. #define C_OPTIMIZE_SWITCH -O
  1833. #endif
  1834.  
  1835. #ifdef __GNUC__
  1836. @configure@ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH
  1837. #else
  1838. @configure@ CFLAGS=C_DEBUG_SWITCH
  1839. #endif
  1840. ' > ${tempcname}
  1841. # The value of CPP is a quoted variable reference, so we need to do this
  1842. # to get its actual value...
  1843. CPP=`eval "echo $CPP"`
  1844. eval `${CPP} -Isrc ${tempcname} \
  1845.        | grep '@configure@' \
  1846.        | sed -e 's/^@configure@ \([^=]*=\)\(.*\)$/\1"\2"/'`
  1847. rm ${tempcname}
  1848.  
  1849. ### Compute the unexec source name from the object name.
  1850. UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`"
  1851.  
  1852. # Do the opsystem or machine files prohibit the use of the GNU malloc?
  1853. # Assume not, until told otherwise.
  1854. GNU_MALLOC=yes
  1855. if [ "${system_malloc}" = "yes" ]; then
  1856.   GNU_MALLOC=no
  1857.   GNU_MALLOC_reason="
  1858.   (The GNU allocators don't work with this system configuration.)"
  1859. fi
  1860.  
  1861. if [ x"${REL_ALLOC}" = x ]; then
  1862.   REL_ALLOC=${GNU_MALLOC}
  1863. fi
  1864.  
  1865. LISP_FLOAT_TYPE=yes
  1866.  
  1867.  
  1868. #### Add the X libraries to the list, and check for some functions found there.
  1869. CFLAGS_save="$CFLAGS"
  1870. CFLAGS="${CFLAGS} ${LD_SWITCH_X_SITE}"
  1871.  
  1872. LIBS_save="${LIBS}"
  1873. LIBS="${LIBS} -lXbsd"
  1874. have_lib=""
  1875. echo checking for -lXbsd
  1876. cat > conftest.c <<EOF
  1877.  
  1878. int main() { exit(0); }
  1879. int t() { main(); }
  1880. EOF
  1881. if eval $compile; then
  1882.   have_lib="1"
  1883. fi
  1884. rm -f conftest*
  1885. LIBS="${LIBS_save}"
  1886. if test -n "${have_lib}"; then
  1887.    {
  1888. test -n "$verbose" && \
  1889. echo '    defining' HAVE_LIBXBSD
  1890. DEFS="$DEFS -DHAVE_LIBXBSD=1"
  1891. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBXBSD\${SEDdB}HAVE_LIBXBSD\${SEDdC}1\${SEDdD}
  1892. \${SEDuA}HAVE_LIBXBSD\${SEDuB}HAVE_LIBXBSD\${SEDuC}1\${SEDuD}
  1893. \${SEDeA}HAVE_LIBXBSD\${SEDeB}HAVE_LIBXBSD\${SEDeC}1\${SEDeD}
  1894. "
  1895. }
  1896.  
  1897.    LIBS="${LIBS} -lXbsd"
  1898. fi
  1899.  
  1900.  
  1901. LIBS_save="$LIBS"
  1902. if [ "${HAVE_X11}" = "yes" ] ; then
  1903.   LIBS="-lX11 ${LIBS}"
  1904. fi
  1905.  
  1906. for func in XrmSetDatabase random
  1907. do
  1908. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  1909. echo checking for ${func}
  1910. cat > conftest.c <<EOF
  1911. #include <ctype.h>
  1912. int main() { exit(0); }
  1913. int t() { 
  1914. /* The GNU C library defines this for functions which it implements
  1915.     to always fail with ENOSYS.  Some functions are actually named
  1916.     something starting with __ and the normal name is an alias.  */
  1917. #if defined (__stub_${func}) || defined (__stub___${func})
  1918. choke me
  1919. #else
  1920. /* Override any gcc2 internal prototype to avoid an error.  */
  1921. extern char ${func}(); ${func}();
  1922. #endif
  1923.  }
  1924. EOF
  1925. if eval $compile; then
  1926.   {
  1927. test -n "$verbose" && \
  1928. echo '    defining' ${trfunc}
  1929. DEFS="$DEFS -D${trfunc}=1"
  1930. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  1931. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  1932. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  1933. "
  1934. }
  1935.  
  1936. fi
  1937. rm -f conftest*
  1938. done
  1939.  
  1940.  
  1941. CFLAGS="$CFLAGS_save"
  1942. LIBS="$LIBS_save"
  1943.  
  1944. case "${window_system}:${LIBS}" in
  1945.   x11:*-lXbsd* )
  1946.     if [ -d /usr/X386/include ]; then
  1947.       HAVE_XFREE386=yes
  1948.       if [ "${C_SWITCH_X_SITE}" = "" ]; then
  1949.     C_SWITCH_X_SITE="-I/usr/X386/include"
  1950.       fi
  1951.     fi
  1952.   ;;
  1953. esac
  1954.  
  1955. #### Find out which version of Emacs this is.
  1956. version=`grep 'defconst[     ]*emacs-version' ${srcdir}/lisp/version.el \
  1957.      | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\)\..*$/\1/'`
  1958. if [ x"${version}" = x ]; then
  1959.   echo "${progname}: can't find current emacs version in
  1960.     \`${srcdir}/lisp/version.el'." >&2
  1961.   exit 1
  1962. fi
  1963.  
  1964.  
  1965. #### Specify what sort of things we'll be editing into Makefile and config.h.
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980. {
  1981. test -n "$verbose" && \
  1982. echo '    defining' config_machfile to be '"\"${machfile}\""'
  1983. DEFS="$DEFS -Dconfig_machfile="\"${machfile}\"""
  1984. SEDDEFS="${SEDDEFS}\${SEDdA}config_machfile\${SEDdB}config_machfile\${SEDdC}"\"${machfile}\""\${SEDdD}
  1985. \${SEDuA}config_machfile\${SEDuB}config_machfile\${SEDuC}"\"${machfile}\""\${SEDuD}
  1986. \${SEDeA}config_machfile\${SEDeB}config_machfile\${SEDeC}"\"${machfile}\""\${SEDeD}
  1987. "
  1988. }
  1989.  
  1990. {
  1991. test -n "$verbose" && \
  1992. echo '    defining' config_opsysfile to be '"\"${opsysfile}\""'
  1993. DEFS="$DEFS -Dconfig_opsysfile="\"${opsysfile}\"""
  1994. SEDDEFS="${SEDDEFS}\${SEDdA}config_opsysfile\${SEDdB}config_opsysfile\${SEDdC}"\"${opsysfile}\""\${SEDdD}
  1995. \${SEDuA}config_opsysfile\${SEDuB}config_opsysfile\${SEDuC}"\"${opsysfile}\""\${SEDuD}
  1996. \${SEDeA}config_opsysfile\${SEDeB}config_opsysfile\${SEDeC}"\"${opsysfile}\""\${SEDeD}
  1997. "
  1998. }
  1999.  
  2000. {
  2001. test -n "$verbose" && \
  2002. echo '    defining' LD_SWITCH_X_SITE to be '${LD_SWITCH_X_SITE}'
  2003. DEFS="$DEFS -DLD_SWITCH_X_SITE=${LD_SWITCH_X_SITE}"
  2004. SEDDEFS="${SEDDEFS}\${SEDdA}LD_SWITCH_X_SITE\${SEDdB}LD_SWITCH_X_SITE\${SEDdC}${LD_SWITCH_X_SITE}\${SEDdD}
  2005. \${SEDuA}LD_SWITCH_X_SITE\${SEDuB}LD_SWITCH_X_SITE\${SEDuC}${LD_SWITCH_X_SITE}\${SEDuD}
  2006. \${SEDeA}LD_SWITCH_X_SITE\${SEDeB}LD_SWITCH_X_SITE\${SEDeC}${LD_SWITCH_X_SITE}\${SEDeD}
  2007. "
  2008. }
  2009.  
  2010. {
  2011. test -n "$verbose" && \
  2012. echo '    defining' C_SWITCH_X_SITE to be '${C_SWITCH_X_SITE}'
  2013. DEFS="$DEFS -DC_SWITCH_X_SITE=${C_SWITCH_X_SITE}"
  2014. SEDDEFS="${SEDDEFS}\${SEDdA}C_SWITCH_X_SITE\${SEDdB}C_SWITCH_X_SITE\${SEDdC}${C_SWITCH_X_SITE}\${SEDdD}
  2015. \${SEDuA}C_SWITCH_X_SITE\${SEDuB}C_SWITCH_X_SITE\${SEDuC}${C_SWITCH_X_SITE}\${SEDuD}
  2016. \${SEDeA}C_SWITCH_X_SITE\${SEDeB}C_SWITCH_X_SITE\${SEDeC}${C_SWITCH_X_SITE}\${SEDeD}
  2017. "
  2018. }
  2019.  
  2020. {
  2021. test -n "$verbose" && \
  2022. echo '    defining' UNEXEC_SRC to be '${UNEXEC_SRC}'
  2023. DEFS="$DEFS -DUNEXEC_SRC=${UNEXEC_SRC}"
  2024. SEDDEFS="${SEDDEFS}\${SEDdA}UNEXEC_SRC\${SEDdB}UNEXEC_SRC\${SEDdC}${UNEXEC_SRC}\${SEDdD}
  2025. \${SEDuA}UNEXEC_SRC\${SEDuB}UNEXEC_SRC\${SEDuC}${UNEXEC_SRC}\${SEDuD}
  2026. \${SEDeA}UNEXEC_SRC\${SEDeB}UNEXEC_SRC\${SEDeC}${UNEXEC_SRC}\${SEDeD}
  2027. "
  2028. }
  2029.  
  2030.  
  2031.  
  2032. if [ "${HAVE_X_WINDOWS}" = "yes" ] ; then
  2033.    {
  2034. test -n "$verbose" && \
  2035. echo '    defining' HAVE_X_WINDOWS
  2036. DEFS="$DEFS -DHAVE_X_WINDOWS=1"
  2037. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_X_WINDOWS\${SEDdB}HAVE_X_WINDOWS\${SEDdC}1\${SEDdD}
  2038. \${SEDuA}HAVE_X_WINDOWS\${SEDuB}HAVE_X_WINDOWS\${SEDuC}1\${SEDuD}
  2039. \${SEDeA}HAVE_X_WINDOWS\${SEDeB}HAVE_X_WINDOWS\${SEDeC}1\${SEDeD}
  2040. "
  2041. }
  2042.  
  2043. fi
  2044. if [ "${HAVE_X11}" = "yes" ] ; then
  2045.    {
  2046. test -n "$verbose" && \
  2047. echo '    defining' HAVE_X11
  2048. DEFS="$DEFS -DHAVE_X11=1"
  2049. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_X11\${SEDdB}HAVE_X11\${SEDdC}1\${SEDdD}
  2050. \${SEDuA}HAVE_X11\${SEDuB}HAVE_X11\${SEDuC}1\${SEDuD}
  2051. \${SEDeA}HAVE_X11\${SEDeB}HAVE_X11\${SEDeC}1\${SEDeD}
  2052. "
  2053. }
  2054.  
  2055. fi
  2056. if [ "${HAVE_XFREE386}" = "yes" ] ; then
  2057.    {
  2058. test -n "$verbose" && \
  2059. echo '    defining' HAVE_XFREE386
  2060. DEFS="$DEFS -DHAVE_XFREE386=1"
  2061. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_XFREE386\${SEDdB}HAVE_XFREE386\${SEDdC}1\${SEDdD}
  2062. \${SEDuA}HAVE_XFREE386\${SEDuB}HAVE_XFREE386\${SEDuC}1\${SEDuD}
  2063. \${SEDeA}HAVE_XFREE386\${SEDeB}HAVE_XFREE386\${SEDeC}1\${SEDeD}
  2064. "
  2065. }
  2066.  
  2067. fi
  2068. if [ "${HAVE_X_MENU}" = "yes" ] ; then
  2069.    {
  2070. test -n "$verbose" && \
  2071. echo '    defining' HAVE_X_MENU
  2072. DEFS="$DEFS -DHAVE_X_MENU=1"
  2073. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_X_MENU\${SEDdB}HAVE_X_MENU\${SEDdC}1\${SEDdD}
  2074. \${SEDuA}HAVE_X_MENU\${SEDuB}HAVE_X_MENU\${SEDuC}1\${SEDuD}
  2075. \${SEDeA}HAVE_X_MENU\${SEDeB}HAVE_X_MENU\${SEDeC}1\${SEDeD}
  2076. "
  2077. }
  2078.  
  2079. fi
  2080. if [ "${GNU_MALLOC}" = "yes" ] ; then
  2081.    {
  2082. test -n "$verbose" && \
  2083. echo '    defining' GNU_MALLOC
  2084. DEFS="$DEFS -DGNU_MALLOC=1"
  2085. SEDDEFS="${SEDDEFS}\${SEDdA}GNU_MALLOC\${SEDdB}GNU_MALLOC\${SEDdC}1\${SEDdD}
  2086. \${SEDuA}GNU_MALLOC\${SEDuB}GNU_MALLOC\${SEDuC}1\${SEDuD}
  2087. \${SEDeA}GNU_MALLOC\${SEDeB}GNU_MALLOC\${SEDeC}1\${SEDeD}
  2088. "
  2089. }
  2090.  
  2091. fi
  2092. if [ "${REL_ALLOC}" = "yes" ] ; then
  2093.    {
  2094. test -n "$verbose" && \
  2095. echo '    defining' REL_ALLOC
  2096. DEFS="$DEFS -DREL_ALLOC=1"
  2097. SEDDEFS="${SEDDEFS}\${SEDdA}REL_ALLOC\${SEDdB}REL_ALLOC\${SEDdC}1\${SEDdD}
  2098. \${SEDuA}REL_ALLOC\${SEDuB}REL_ALLOC\${SEDuC}1\${SEDuD}
  2099. \${SEDeA}REL_ALLOC\${SEDeB}REL_ALLOC\${SEDeC}1\${SEDeD}
  2100. "
  2101. }
  2102.  
  2103. fi
  2104. if [ "${LISP_FLOAT_TYPE}" = "yes" ] ; then
  2105.    {
  2106. test -n "$verbose" && \
  2107. echo '    defining' LISP_FLOAT_TYPE
  2108. DEFS="$DEFS -DLISP_FLOAT_TYPE=1"
  2109. SEDDEFS="${SEDDEFS}\${SEDdA}LISP_FLOAT_TYPE\${SEDdB}LISP_FLOAT_TYPE\${SEDdC}1\${SEDdD}
  2110. \${SEDuA}LISP_FLOAT_TYPE\${SEDuB}LISP_FLOAT_TYPE\${SEDuC}1\${SEDuD}
  2111. \${SEDeA}LISP_FLOAT_TYPE\${SEDeB}LISP_FLOAT_TYPE\${SEDeC}1\${SEDeD}
  2112. "
  2113. }
  2114.  
  2115. fi
  2116.  
  2117.  
  2118. #### Report on what we decided to do.
  2119. echo "
  2120.  
  2121. Configured for \`${configuration}'.
  2122.  
  2123.   Where should the build process find the source code?    ${srcdir}
  2124.   What operating system and machine description files should Emacs use?
  2125.         \`${opsysfile}' and \`${machfile}'
  2126.   What compiler should emacs be built with?               ${CC} ${CFLAGS}
  2127.   Should Emacs use the GNU version of malloc?             ${GNU_MALLOC}${GNU_MALLOC_reason}
  2128.   Should Emacs use the relocating allocator for buffers?  ${REL_ALLOC}
  2129.   What window system should Emacs use?                    ${window_system}${x_includes+
  2130.   Where do we find X Windows header files?                }${x_includes}${x_libraries+
  2131.   Where do we find X Windows libraries?                   }${x_libraries}
  2132.  
  2133. "
  2134.  
  2135. if test -n "$prefix"; then
  2136.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  2137.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  2138. fi
  2139. if test -n "$exec_prefix"; then
  2140.   prsub="$prsub
  2141. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  2142. fi
  2143. cat >conftest.def <<EOF
  2144. $DEFS
  2145. EOF
  2146. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  2147. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  2148. rm -f conftest.def
  2149.  
  2150. trap 'rm -f config.status; exit 1' 1 3 15
  2151. echo creating config.status
  2152. rm -f config.status
  2153. cat > config.status <<EOF
  2154. #!/bin/sh
  2155. # Generated automatically by configure.
  2156. # Run this file to recreate the current configuration.
  2157. # This directory was configured as follows,
  2158. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  2159. #
  2160. # $0 $configure_args
  2161.  
  2162. for arg
  2163. do
  2164.   case "\$arg" in
  2165.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  2166.     exec /bin/sh $0 $configure_args ;;
  2167.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  2168.   esac
  2169. done
  2170.  
  2171. trap 'rm -fr Makefile src/config.h conftest*; exit 1' 1 3 15
  2172. CC='$CC'
  2173. LN_S='$LN_S'
  2174. CPP='$CPP'
  2175. INSTALL='$INSTALL'
  2176. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  2177. INSTALL_DATA='$INSTALL_DATA'
  2178. YACC='$YACC'
  2179. ALLOCA='$ALLOCA'
  2180. configuration='$configuration'
  2181. version='$version'
  2182. srcdir='$srcdir'
  2183. c_switch_system='$c_switch_system'
  2184. libsrc_libs='$libsrc_libs'
  2185. rip_paths='$rip_paths'
  2186. inst_paths='$inst_paths'
  2187. LD_SWITCH_X_SITE='$LD_SWITCH_X_SITE'
  2188. C_SWITCH_X_SITE='$C_SWITCH_X_SITE'
  2189. CFLAGS='$CFLAGS'
  2190. prefix='$prefix'
  2191. exec_prefix='$exec_prefix'
  2192. LIBS='$LIBS'
  2193. prefix='$prefix'
  2194. exec_prefix='$exec_prefix'
  2195. prsub='$prsub'
  2196. EOF
  2197. cat >> config.status <<\EOF
  2198.  
  2199. top_srcdir=$srcdir
  2200.  
  2201. # Allow make-time overrides of the generated file list.
  2202. test -n "$gen_files" || gen_files="Makefile"
  2203.  
  2204. for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
  2205.   srcdir=$top_srcdir
  2206.   # Remove last slash and all that follows it.  Not all systems have dirname.
  2207.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  2208.   if test "$dir" != "$file"; then
  2209.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  2210.     test ! -d $dir && mkdir $dir
  2211.   fi
  2212.   echo creating $file
  2213.   rm -f $file
  2214.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  2215.   sed -e "
  2216. $prsub
  2217. s%@CC@%$CC%g
  2218. s%@LN_S@%$LN_S%g
  2219. s%@CPP@%$CPP%g
  2220. s%@INSTALL@%$INSTALL%g
  2221. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  2222. s%@INSTALL_DATA@%$INSTALL_DATA%g
  2223. s%@YACC@%$YACC%g
  2224. s%@ALLOCA@%$ALLOCA%g
  2225. s%@configuration@%$configuration%g
  2226. s%@version@%$version%g
  2227. s%@srcdir@%$srcdir%g
  2228. s%@c_switch_system@%$c_switch_system%g
  2229. s%@libsrc_libs@%$libsrc_libs%g
  2230. s%@rip_paths@%$rip_paths%g
  2231. s%@inst_paths@%$inst_paths%g
  2232. s%@LD_SWITCH_X_SITE@%$LD_SWITCH_X_SITE%g
  2233. s%@C_SWITCH_X_SITE@%$C_SWITCH_X_SITE%g
  2234. s%@CFLAGS@%$CFLAGS%g
  2235. s%@prefix@%$prefix%g
  2236. s%@exec_prefix@%$exec_prefix%g
  2237. s%@LIBS@%$LIBS%g
  2238. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  2239. fi; done
  2240. test -n "$gen_config" || gen_config=src/config.h
  2241. echo creating $gen_config
  2242. # These sed commands are put into SEDDEFS when defining a macro.
  2243. # They are broken into pieces to make the sed script easier to manage.
  2244. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  2245. # is the cpp macro being defined and VALUE is the value it is being given.
  2246. # Each defining turns into a single global substitution command.
  2247. #
  2248. # SEDd sets the value in "#define NAME VALUE" lines.
  2249. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  2250. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  2251. SEDdC='\3'
  2252. SEDdD='@g'
  2253. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  2254. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2255. SEDuB='\([     ]\)@\1#\2define\3'
  2256. SEDuC=' '
  2257. SEDuD='\4@g'
  2258. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  2259. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2260. SEDeB='$@\1#\2define\3'
  2261. SEDeC=' '
  2262. SEDeD='@g'
  2263. rm -f conftest.sed
  2264. EOF
  2265. # Turn off quoting long enough to insert the sed commands.
  2266. rm -f conftest.sh
  2267. cat > conftest.sh <<EOF
  2268. $SEDDEFS
  2269. EOF
  2270.  
  2271. # Maximum number of lines to put in a single here document.
  2272. maxshlines=9
  2273.  
  2274. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  2275. # on the size of here documents.
  2276.  
  2277. while :
  2278. do
  2279.   lines=`grep -c . conftest.sh`
  2280.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  2281.   rm -f conftest.s1 conftest.s2
  2282.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  2283.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  2284.   # Write a limited-size here document to append to conftest.sed.
  2285.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  2286.   cat conftest.s1 >> config.status
  2287.   echo 'CONFEOF' >> config.status
  2288.   rm -f conftest.s1 conftest.sh
  2289.   mv conftest.s2 conftest.sh
  2290. done
  2291. rm -f conftest.sh
  2292.  
  2293. # Now back to your regularly scheduled config.status.
  2294. cat >> config.status <<\EOF
  2295. # This sed command replaces #undef's with comments.  This is necessary, for
  2296. # example, in the case of _POSIX_SOURCE, which is predefined and required
  2297. # on some systems where configure will not decide to define it in
  2298. # src/config.h.
  2299. cat >> conftest.sed <<\CONFEOF
  2300. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  2301. CONFEOF
  2302. rm -f conftest.h
  2303. # Break up the sed commands because old seds have small limits.
  2304. maxsedlines=20
  2305. cp $top_srcdir/$gen_config.in conftest.h1
  2306. while :
  2307. do
  2308.   lines=`grep -c . conftest.sed`
  2309.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  2310.   rm -f conftest.s1 conftest.s2 conftest.h2
  2311.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  2312.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  2313.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  2314.   rm -f conftest.s1 conftest.h1 conftest.sed
  2315.   mv conftest.h2 conftest.h1
  2316.   mv conftest.s2 conftest.sed
  2317. done
  2318. rm -f conftest.sed conftest.h
  2319. echo "/* $gen_config.  Generated automatically by configure.  */" > conftest.h
  2320. cat conftest.h1 >> conftest.h
  2321. rm -f conftest.h1
  2322. if cmp -s $gen_config conftest.h 2>/dev/null; then
  2323.   # The file exists and we would not be changing it.
  2324.   rm -f conftest.h
  2325. else
  2326.   rm -f $gen_config
  2327.   mv conftest.h $gen_config
  2328. fi
  2329.  
  2330.  
  2331. exit 0
  2332. EOF
  2333. chmod +x config.status
  2334. test -n "$no_create" || ./config.status
  2335.  
  2336.